/*  ----------------------------------------------------------------------------
 *  Arello Mobile
 *  Fast 3d Engine
 *  ----------------------------------------------------------------------------
 * Except where otherwise noted, this work is licensed under
 * http://creativecommons.org/licenses/by/3.0
 */

#include <animate/Node.h>

namespace liba {
namespace animate {

Node * Node::FindAnimateNodeInternal(const AtomPath & path, int curr_element)
{
	if( curr_element == path.size() )
		return this;
	Node * node = FindAnimateNode( path[curr_element], false );
	if( !node )
		return 0;
	return node->FindAnimateNodeInternal( path, curr_element + 1 );
}
Node * Node::FindAnimateNode(const AtomPath & path, bool recursion)
{
	if( path.empty() )
		return this;
	Node * node = FindAnimateNode( path[0], recursion );
	if( !node )
		return 0;
	return node->FindAnimateNodeInternal( path, 1 );
}

} // namespace animate
} // namespace liba

